package com.xy.demo.Util;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Model extends Data implements Serializable {

	private static final long serialVersionUID = 1L;
	
	public Model() {
	}
	
	public Long getPk() {
		return null;
	}
	
	public Long getEntityId() {
		return getPk();
	}
	
	public Long getId() {
		return getPk();
	}
	
	public boolean isNew() {
		return getPk() == null || Util.toLong(getPk()) == 0;
	}
	
	public boolean isLoaded() {
		return true;
	}
	
}
